Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing YAML mapping IT #32851

Merged
merged 2 commits into from
Oct 18, 2024
Merged

Fix failing YAML mapping IT #32851

merged 2 commits into from
Oct 18, 2024

Conversation

Polber
Copy link
Contributor

@Polber Polber commented Oct 17, 2024

Workaround for #32832


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

Signed-off-by: Jeffrey Kinard <[email protected]>
@Polber
Copy link
Contributor Author

Polber commented Oct 17, 2024

R: @robertwb

Copy link
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment assign set of reviewers

literal_int: 10
named_field: element
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this order respected but the other ordering wasn't?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were in essence 2 issues (or 1 issue that required 2 fixes)

  1. Due to Schema inference parameterized types #32757 (for reasons I'm not entirely sure of), the ordering of the Row sent from the Java MapToFields transform was changed. To fix this, I reordered the expected output in the AssertEqual
  2. Because the change in 1) did not affect Python Rows, the AssertEqual would now fail for Python MapToFields since the order of the output Row did not change. To fix this, I changed the order of the fields in the config to reflect the new order in the AssertEqual

Ideally, the Java transform should not be changing the order (given that Python respects order, Java probably should too now that cross-language is so widespread), but I wanted to get tests green (and initially I thought this was a problem with the __eq__ being too restrictive with key order).

Perhaps more investigation should be done on #32757 to see why the ordering changed, or at the very least, I could open a bug about how Row ordering changes over Xlang.

Copy link
Contributor Author

@Polber Polber Oct 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there was a change to sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/transforms/providers/JavaRowUdf.java in that PR (more specifically StaticSchemaInference.fieldFromType) which likely messed with how the schema was parsed in Java MapToFields

Actually that is per field, so it is more likely something else more tied to how expansion service parses the Schema. I can look into it next week if it is still an issue

@Polber Polber requested a review from robertwb October 17, 2024 23:15
Copy link
Contributor

@robertwb robertwb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the detailed explanation. Let's get this in to unblock things.

@robertwb robertwb merged commit a163dd0 into apache:master Oct 18, 2024
36 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants